package cn.ecut.servlet;

import cn.ecut.model.User;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/getuser")
public class GetUserSession extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        User user = new User(1, "zhangsan", "qweasd", "123456", "男", "zhangsan@qq.com");
        request.getSession().setAttribute("user",user);
//        response.sendRedirect("/mypost");
    }
}
